using BasicData.API.Dtos;
using BasicData.ErrorCode;
using MediatR;
using System;
using System.ComponentModel.DataAnnotations;

namespace BasicData.API.Application.Command
{
    /// <summary>
    /// 添加生产信息命令
    /// </summary>
    public class AddProductionInfoCommand : IRequest<APIResult<ProductionInfoDTO>>
    {
        /// <summary>
        /// 生产批次
        /// </summary>
        [Required(ErrorMessage = "生产批次不能为空")]
        [MaxLength(100, ErrorMessage = "生产批次最大长度为100")]
        public string BatchNumber { get; set; } = null!;

        /// <summary>
        /// 保质期（天）
        /// </summary>
        [Required(ErrorMessage = "保质期不能为空")]
        [Range(1, 3650, ErrorMessage = "保质期必须在1-3650天之间")]
        public int ShelfLifeDays { get; set; }

        /// <summary>
        /// 生产许可证号
        /// </summary>
        [MaxLength(100, ErrorMessage = "生产许可证号最大长度为100")]
        public string? ProductionLicenseNumber { get; set; }

        /// <summary>
        /// 生产企业
        /// </summary>
        [MaxLength(200, ErrorMessage = "生产企业名称最大长度为200")]
        public string? ManufacturerName { get; set; }

        /// <summary>
        /// 封面图
        /// </summary>
        [MaxLength(500, ErrorMessage = "封面图URL最大长度为500")]
        public string? CoverImageUrl { get; set; }

        /// <summary>
        /// 商品Id
        /// </summary>
        [Required(ErrorMessage = "商品ID不能为空")]
        public int GoodsId { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string? CreatedBy { get; set; }
    }
} 